/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bai3;

import java.io.File;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.helpers.DefaultHandler;

/**
 *
 * @author ngadtt
 */
public class SaxContentProcessing extends DefaultHandler {

    static String user = null;
    static boolean found = false;
    static boolean IDfound = false;
    static boolean namefound = false;

    public static void main(String[] args) {
        if (args.length != 1) {
            System.out.println("haaaaaaaaaaaa");
            System.exit(1);
        }
        SaxContentProcessing saxObject = new SaxContentProcessing();
        SAXParserFactory spf = SAXParserFactory.newInstance();
        try {
            SAXParser parser = spf.newSAXParser();
            parser.parse(new File("tomcat-users.xml"), saxObject);
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
}
